<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>国省自检--${fns:getConfig('productName')}</title>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
<script type="text/javascript">
    function btnClick(){
        var url = '${ctx}/roadHardenCon/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
        var data = {};
       	data['retrieval'] = getJson('condition');
       	loadData(url,data);
    }
    //ajax执行成功之后的回调方法
    function loadDataToTable(data){
        var attData = data['att'];
        var score = data['score'];
        var itemNum = data['itemNum'];
        var workNum = data['workNum'];
        var completeNum = data['completeNum'];
        var acceptNum = data['acceptNum'];
        var scoreFirst = data['scoreFirst'];
        var scoreResult = data['scoreResult'];
        var yhRoadConstrAs = data['yhRoadConstrAs'];
        var yhRoadLists = data['yhRoadLists'];
        var percent = data['percent'];
        //检索附件的回调方法
        loadAttachment(attData);
       if(data['flagOne']){
    	   //回调填充评分表一：
       		var contentOne = '<table style="width:98%;  text-align:center;margin-top:5px;" border="1"><thead><tr style="height:30px">'+
					            '<th>年度</th>'+
					            '<th>项目总数</th>'+
					            '<th>开工数量</th>'+
					            '<th>完工数量</th>'+
					            '<th>验收数量</th>'+
					            '<th>检查得分</th>'+
					            '<th>检查总分</th>'+
					            '<th>完善度</th></tr></thead><tbody>';
			for (var i = 0; i < yhRoadConstrAs.length; i++) {
				contentOne += '<tr><td>'+yhRoadConstrAs[i].year+'</td><td>'+yhRoadConstrAs[i].itemNum+'</td><td>'+yhRoadConstrAs[i].workNum+'</td><td>'+yhRoadConstrAs[i].completeNum+'</td><td>'+yhRoadConstrAs[i].acceptNum+'</td>';
				if (i == 0 ) {
					contentOne += '<td rowspan="'+(yhRoadConstrAs.length+1)+'">'+scoreFirst+'<td class="sumTd" rowspan="'+(yhRoadConstrAs.length+1)+'">'+score+'</td><td class="perTd"   rowspan="'+(yhRoadConstrAs.length+1)+'">'+percent+'%</td></tr>';
				} else if( i == yhRoadConstrAs.length-1) {
					contentOne += '<tr><td>'+"汇总数据"+'</td><td>'+itemNum+'</td><td>'+workNum+'</td><td>'+completeNum+'</td><td>'+acceptNum+'</td></tr>';	
				} else {
					contentOne += '</tr>';
				}
			}
			contentOne += '</tbody></table>';
           $('#checkResult').append(contentOne);
       }
        //表二：
       if(data['flagTwo']){
    	   	var tr = "";
           	var contentTwo = '<table style="width:98%; text-align:center;margin-top:25px;" border="1"><thead><tr style="height:31px">'+
   					        	'<th>序号</th>'+
   					        	'<th>项目名称</th>'+
   					            '<th>年份</th>'+
   					            '<th>计划规模</th>'+
   					            '<th>实施情况</th>'+
   					            '<th>验收情况</th>'+
   					            '<th>检查得分</thead><tbody>';
   				for(var i=0; i<yhRoadLists.length; i++){
   					tr += '<tr><td>'+(i+1)+'</td><td>'+yhRoadLists[i].projectName+'</td><td>'+yhRoadLists[i].year+'</td><td>'+Pengtu.buildCodeName(6010,yhRoadLists[i].planScale)+'</td><td>'+Pengtu.buildCodeName(1000,yhRoadLists[i].workSituation)+'</td><td>'+Pengtu.buildCodeName(1000,yhRoadLists[i].completeSituation)+'</td><td>'+scoreResult[i]+'</td></tr>';
   				}
               contentTwo += tr + '</tr></tbody></table>';
               $('#checkResult').append(contentTwo);
            }
        }
</script>
</head>
<body>
    <div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/roadHardenCon/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
    <form id="checkForm" class="form-horizontal"  method="POST"  name="checkForm" action="${ctx}/roadHardenCon/save.do?left=${fns:encodeParam(left)}&parentId=${fns:encodeParam(parentId)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}">
        <input type="hidden" name="token" value="${token}">
        <div id="show">
            <div id="showTable" class="showTable">
                <jsp:include page="/WEB-INF/views/check/common.jsp"/>
				<div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="float:left;margin-right:10px;">
							<div>
                        		<span>选择新农村公路路面硬化工程项目<font style="color:red;">*</font>：</span>
								<tags:treeselect id="office" name="itemProjectId" value="" labelName="objectName" labelValue=""
									title="单位" url="/roadHardenCon/roadHardenConData.do?projectId=${projectId}" allowClear="true" checked ="true"/>
                          	</div>
							<div style="margin-top:20px">
								<span>每个部、省补助新农村公路路面硬化工程项目总分<font style="color:red;">*</font>：</span>
                          		 	<input type="text" name="yearFull" id="yearFull" maxlength="6" class="required conInput" value='8'>
							</div>
							<div style="margin-top:18px">
								<span>每个未开工的项目扣分<font style="color:red;">*</font>：</span>
                           			<input type="text" name="firstStepScore" id="firstStepScore" maxlength="6" class="required conInput" value='0.3'>
								<span  style='margin-left:30px;'>每个开工未完工的项目扣分<font style="color:red;">*</font>：</span>
                           			<input type="text" name="secondStepScore" id="secondStepScore" maxlength="6" class="required conInput" value='0.2'>
								<span  style='margin-left:30px;'>每个完工未验收的项目扣分<font style="color:red;">*</font>：</span>
                           			<input type="text" name="thirdStepScore" id="thirdStepScore" maxlength="6" class="required conInput" value='0.1'>
							</div>
							<div style="margin-top:22px">
								<span>每个新农村公路路面硬化工程项目满分<font style="color:red;">*</font>：</span>
                           			<input type="text" name="fourthStepScore" id="fourthStepScore" maxlength="6" class="required conInput" value='2.5'>
								<span  style='margin-left:50px;'>每项工程发现一个问题扣分<font style="color:red;">*</font>：</span>
                           			<input type="text" name="fifthStepScore" id="fifthStepScore" maxlength="6" class="required conInput" value='0.5'>
							</div>
                           	</div>
                           	<div id="x_s" style="float:right">
								<div class="x_ico"></div>
								<a href="#javascript:void(0)" onclick= "btnClick();"  id= "btnSearch" role="button" >搜索&nbsp;</a>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
					<div>
						<legend>四、检索结果</legend>
						<div class="content-title">
							<div class="tabbox">
								<div class="tab">
									<a href="javascript:;" class="on">规章制度</a>
									<c:forEach items="${childMenuList}" var="menu" varStatus="idxStatus">
										<c:if test="${idxStatus.index >= 3}">
											<a href="javascript:;">${menu.name}</a>
										</c:if>
									</c:forEach>
								</div>
								<div class="content">
									<ul>
										<li>
										<c:forEach items="${childMenuList}" var="menu" varStatus="idxStatus">
											<c:if test="${idxStatus.index >= 2}">
												<li>
													<table style="width: 98%; text-align: center; margin-top: 5px;" border="1" id="${menu.tag}">
														<thead>
															<th>序号</th>
															<th>操作</th>
															<th>发文单位</th>
															<th>上传用户</th>
															<th>文件名</th>
															<th>发文日期</th>
															<th>上传日期</th>
															<th>文件大小</th>
															<th>文件类型</th>
														</thead>
														<tbody>

														</tbody>
													</table>
												</li>
											</c:if>
										</c:forEach>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="model">
                    <div>
                    	<legend>五、检查评分</legend>
                        <div class="context-title" id="checkResult">
                           
                        </div>
                    </div>
                </div>
                <div class="model">
                    <div class="content-btn">
                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
                    </div>
                </div>
            </div>
        </div>
    </form>
    <script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>